#define renderInputType(col, formModel='model')

#set(dictType = col.dictType)
#set(javaField = col.javaField)
#set(javaType = col.javaType)
#set(attrName = col.javaField.substring(0,1).toUpperCase() + col.javaField.substring(1))
#set(comment = col.columnComment)

#switch(col.htmlType)
#case("button")
### button do nothing
#case("checkbox")
      <el-form-item label="#(comment)" prop="#(javaField)">
        <el-checkbox-group v-model="#(formModel).#(javaField)">
                #if ("" != dictType)### 有数据字典
          <el-checkbox
            v-for="dict in #(dictMethod)(DICT_TYPE.#(dictType.toUpperCase()))"
            :key="dict.value"
            :label="dict.value"
          >
            {{ dict.label }}
          </el-checkbox>
                #else### 没数据字典
          <el-checkbox>请选择字典生成</el-checkbox>
                #end
        </el-checkbox-group>
      </el-form-item>
#case("color")
### color do nothing
#case("date","datetime-local", "datetime")
      <el-form-item label="#(comment)" prop="#(javaField)">
        <el-date-picker
          v-model="formData.#(javaField)"
          type="date"
          value-format="x"
          placeholder="选择#(comment)"
        />
      </el-form-item>
#case("email")
### email do nothing
#case("file","fileUpload")
      <el-form-item label="#(comment)" prop="#(javaField)">
        <UploadFile v-model="formData.#(javaField)" />
      </el-form-item>
#case("hidden")
### hidden do nothing
#case("image","imageUpload")
      <el-form-item label="#(comment)" prop="#(javaField)">
        <UploadImg v-model="formData.#(javaField)" />
      </el-form-item>
#case("month")
### month do nothing
#case("number")
### number do nothing
#case("password")
### password do nothing
#case("radio")
      <el-form-item label="#(comment)" prop="#(javaField)">
        <el-radio-group v-model="formData.#(javaField)">
                #if ("" != dictType)### 有数据字典
          <el-radio
            v-for="dict in #(dictMethod)(DICT_TYPE.#(dictType.toUpperCase()))"
            :key="dict.value"
            :label="dict.value"
          >
            {{ dict.label }}
          </el-radio>
                #else###没数据字典
          <el-radio label="1">请选择字典生成</el-radio>
                #end
        </el-radio-group>
      </el-form-item>
#case("range")
### range do nothing
#case("reset")
### reset do nothing
#case("search")
### search do nothing
#case("submit")
### submit do nothing
#case("tel")
### tel do nothing
#case("input", "text")
    <NFormItem label="#(col.comment)" path="#(col.name)">
      <NInput v-model:value="#(formModel).#(col.name)" placeholder="#(col.comment)" />
    </NFormItem>
#case("time")
### time do nothing
#case("url")
### url do nothing
#case("week")
### week do nothing

#case("editor")### 非html标准控件
      <el-form-item label="#(comment)" prop="#(javaField)">
        <Editor v-model="formData.#(javaField)" height="150px" />
      </el-form-item>
#case("select")### 参考 https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/select
      <el-form-item label="#(comment)" prop="#(javaField)">
        <el-select v-model="formData.#(javaField)" placeholder="请选择#(comment)">
                #if ("" != dictType)### 有数据字典
          <el-option
            v-for="dict in #(dictMethod)(DICT_TYPE.#(dictType.toUpperCase()))"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
                #else### 没数据字典
          <el-option label="请选择字典生成" value="" />
                #end
        </el-select>
      </el-form-item>
#case("textarea")### 参考 https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/textarea
      <el-form-item label="#(comment)" prop="#(javaField)">
        <el-input v-model="formData.#(javaField)" type="textarea" placeholder="请输入#(comment)" />
      </el-form-item>
#default
#end
#end